package cn.cyq.readerhelper.common;

import cn.cyq.readerhelper.ocrjdk.MyAipOcr;
import com.baidu.aip.ocr.AipOcr;
import com.baidu.aip.speech.AipSpeech;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanFac {

    @Bean
    public MyAipOcr aipOcr(BaiduOcrConf baiduOcrConf) {
        MyAipOcr aipOcr = new MyAipOcr(baiduOcrConf.getAppid(), baiduOcrConf.getApikey(), baiduOcrConf.getSecretkey());
        return aipOcr;
    }

    @Bean
    public AipSpeech aipSpeech(BaiSpeechConf speechConf) {
        AipSpeech aipSpeech = new AipSpeech(speechConf.getAppid(), speechConf.getApikey(), speechConf.getSecretkey());
        return aipSpeech;
    }
}
